package com.buer.storage.service.impl;

import com.buer.storage.dao.WorderdetailsDao;
import com.buer.storage.entity.WorderdetailsDO;
import com.buer.storage.service.WorderdetailsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class WorderdetailsServiceImpl implements WorderdetailsService {
	@Autowired
	private WorderdetailsDao worderdetailsDao;
	
	@Override
	public WorderdetailsDO get(Integer detailsId){
		return worderdetailsDao.get(detailsId);
	}
	
	@Override
	public List<WorderdetailsDO> list(Map<String, Object> map){
		return worderdetailsDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return worderdetailsDao.count(map);
	}
	
	@Override
	public int save(WorderdetailsDO worderdetails){
		return worderdetailsDao.save(worderdetails);
	}
	
	@Override
	public int update(WorderdetailsDO worderdetails){
		return worderdetailsDao.update(worderdetails);
	}
	
	@Override
	public int remove(Integer detailsId){
		return worderdetailsDao.remove(detailsId);
	}
	
	@Override
	public int batchRemove(Integer[] detailsIds){
		return worderdetailsDao.batchRemove(detailsIds);
	}

    @Override
    public PageInfo<WorderdetailsDO> getWorderdetailsList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<WorderdetailsDO> list = worderdetailsDao.getWorderdetailsList(map); // 获取数据
        PageInfo<WorderdetailsDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public WorderdetailsDO getOne(Map<String, Object> map){
        return worderdetailsDao.getOne(map);
    }
	
}
